package com.javaEE.tes.dao;

import com.javaEE.tes.dao.dto.CharData;
import com.javaEE.tes.entities.Student;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import java.util.List;

public interface GenderRepository extends CrudRepository<Student,Long> {
    @Query(nativeQuery = true,value = "SELECT gender AS label, COUNT(*) AS value FROM student GROUP BY gender")
    List<CharData> getGender();
}
